{
  "properties" : { },
  "id" : "ed69e57d2c52440bac29cf35728a93f6",
  "script" : null,
  "groupId" : "9cdf911ce9e04b62976717998469c655",
  "name" : "查询设备面板的xml信息",
  "createTime" : 1727071143794,
  "updateTime" : 1724983449213,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "detail",
  "method" : "GET",
  "parameters" : [ {
    "name" : "modelid",
    "value" : "1438798309655351298",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "taskId",
      "value" : "1819188656790945793",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "updateTime",
      "value" : "2024-08-23 17:17:10",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "current",
      "value" : "1",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "size",
      "value" : "4",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  },
  "responseBodyDefinition" : null
}
================================
import java.net.URLEncoder
import response;
import java.io.ByteArrayInputStream;
import java.io.InputStream
import cn.hutool.core.io.IoUtil;

var detail = db.table("ndmp_device_panel").where().eq("modelid", modelid).selectOne()

ServletOutputStream out = null;

if (null != detail) {
    String encode = URLEncoder.encode(detail.get("modelname"), "UTF-8").replace("+", "%20");
    response.setHeader("Content-disposition", "attachment;filename=" + encode + ";panelid=" + detail.get("panelid"));
    response.setHeader("Content-type", "application/octet-stream");
    var panelpict = detail.get("panelpict");
    if (null != panelpict && panelpict.length > 0) {
        InputStream is = new ByteArrayInputStream(panelpict);
        out = response.getOutputStream();
        IoUtil.copy( is , out, IoUtil.DEFAULT_BUFFER_SIZE);
        out.flush();
        out.close();
    } else {
        String res = "暂无此设备面板信息";
        response.getOutputStream().write(res.getBytes());
    }
} else {
    String res = "暂无此设备面板信息";
    response.getOutputStream().write(res.getBytes());
}